<?php

namespace app\common\model;

trait ModelTrait
{
    // 定义全局的查询范围
    protected $globalScope = ['status'];

    public function scopeStatus($query)
    {
        $query->where('status', 1);
    }
}
